<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Document</title>
</head>

<body>
	<form action="#">
		<select name="" id="city">
			<option value="beijing" id="bj">北京</option>
			<option value="nanjing">南京</option>
			<option value="tianjin">天津</option>
		</select>
		<select name="" id="city2" multiple size="5">
			<option value="beijing">北京</option>
			<option value="nanjing">南京</option>
			<option value="tianjin">天津</option>
		</select>

	</form>

	<script>
		var city = document.getElementById('city')
		console.log(city.length);
		console.log(city.options);
		console.log(city.selectedIndex); //默认的被选中的<option>元素的索引值
		console.log(city.size);
		
		var city2 = document.getElementById('city2')
		console.log(city2.size);
		console.log(city2.item(2));
		city2.remove(2);
		
		var bj = document.getElementById('bj')
		console.log(bj.index); 
		console.log(bj.text);
		console.log(bj.selected);
		console.log(bj.value);
		
	</script>
</body>

</html>